﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Cosmetic.DataEntity;
using System.Collections;
using System.Data.SqlClient;
using System.Configuration;
using System.Data;

namespace Cosmetic.Logic
{
   public  class infoManger: LogicBase
    {
       public void Insert(infor aUser)
       {
           m_CosmeticDC.infor .InsertOnSubmit(aUser);
           m_CosmeticDC.SubmitChanges();
       }

       /// <summary>
       /// 判断是否存在此手机用户
       /// </summary>
       /// <param name="tel">The product want delete</param>

       public infor CheckExistes(string uername)
       {
           List<infor > theProductList = (from theProduct in m_CosmeticDC.infor 
                                              where theProduct.tel  == uername
                                              select theProduct).ToList();
           if (theProductList.Count == 1)
           {
               return theProductList[0];
           }
           return null;
       }
       public infor CheckExistemail(string uername)
       {
           List<infor> theProductList = (from theProduct in m_CosmeticDC.infor
                                         where theProduct.email == uername
                                         select theProduct).ToList();
           if (theProductList.Count == 1)
           {
               return theProductList[0];
           }
           return null;
       }

    }
}
